package com.cleaningcloud.cld.service.impl;

import java.util.List;
import com.cleaningcloud.common.core.utils.DateUtils;
import com.cleaningcloud.common.security.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.cleaningcloud.cld.mapper.CldCheckIndicatorMapper;
import com.cleaningcloud.cld.domain.CldCheckIndicator;
import com.cleaningcloud.cld.service.ICldCheckIndicatorService;

/**
 * 指标库Service业务层处理
 * 
 * @author cleaningcloud
 * @date 2024-10-12
 */
@Service
public class CldCheckIndicatorServiceImpl implements ICldCheckIndicatorService 
{
    @Autowired
    private CldCheckIndicatorMapper cldCheckIndicatorMapper;

    /**
     * 查询指标库
     * 
     * @param indicatorId 指标库主键
     * @return 指标库
     */
    @Override
    public CldCheckIndicator selectCldCheckIndicatorByIndicatorId(Long indicatorId)
    {
        return cldCheckIndicatorMapper.selectCldCheckIndicatorByIndicatorId(indicatorId);
    }

    /**
     * 查询指标库列表
     * 
     * @param cldCheckIndicator 指标库
     * @return 指标库
     */
    @Override
    public List<CldCheckIndicator> selectCldCheckIndicatorList(CldCheckIndicator cldCheckIndicator)
    {
        return cldCheckIndicatorMapper.selectCldCheckIndicatorList(cldCheckIndicator);
    }

    /**
     * 新增指标库
     * 
     * @param cldCheckIndicator 指标库
     * @return 结果
     */
    @Override
    public int insertCldCheckIndicator(CldCheckIndicator cldCheckIndicator)
    {
        cldCheckIndicator.setCreateTime(DateUtils.getNowDate());
        cldCheckIndicator.setCreateId(SecurityUtils.getUserId());
        cldCheckIndicator.setCreateName(SecurityUtils.getUsername());
        cldCheckIndicator.setFlag(0L);
        return cldCheckIndicatorMapper.insertCldCheckIndicator(cldCheckIndicator);
    }

    /**
     * 修改指标库
     * 
     * @param cldCheckIndicator 指标库
     * @return 结果
     */
    @Override
    public int updateCldCheckIndicator(CldCheckIndicator cldCheckIndicator)
    {
        return cldCheckIndicatorMapper.updateCldCheckIndicator(cldCheckIndicator);
    }

    /**
     * 批量删除指标库
     * 
     * @param indicatorIds 需要删除的指标库主键
     * @return 结果
     */
    @Override
    public int deleteCldCheckIndicatorByIndicatorIds(Long[] indicatorIds)
    {
        return cldCheckIndicatorMapper.deleteCldCheckIndicatorByIndicatorIds(indicatorIds);
    }

    /**
     * 删除指标库信息
     * 
     * @param indicatorId 指标库主键
     * @return 结果
     */
    @Override
    public int deleteCldCheckIndicatorByIndicatorId(Long indicatorId)
    {
        return cldCheckIndicatorMapper.deleteCldCheckIndicatorByIndicatorId(indicatorId);
    }
}
